# -*- coding: utf-8 -*-

# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: https://docs.scrapy.org/en/latest/topics/item-pipeline.html


class MaoyanPipeline(object):
    def process_item(self, item, spider):
        print(item['name'], item['time'])
        return item

    def open_spider(self, spider):
        # 爬虫程序启动时，只执行一次,一般用于数据库连接
        print('open函数')
        pass

    def close_spider(self, spider):
        # 爬虫程序结束时，只执行一次，一般用于断开数据库连接
        print('close函数')
        pass
